home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / cp2dekit / h / pfilesel.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-29  |  4.1 KB  |  158 lines

  1. //***************************************************************************
  2. //
  3. // this file is (c) '94-'96 Niklas Beisert
  4. //
  5. // this file is part of the cubic player development kit.
  6. // you may only use/modify/spread this file under the terms stated
  7. // in the cubic player development kit accompanying documentation.
  8. //
  9. //***************************************************************************
  10.  
  11. #ifndef __PFILESEL_H
  12. #define __PFILESEL_H
  13.  
  14. class binfile;
  15.  
  16. struct moduleinfostruct
  17. {
  18. #define MDB_USED 1
  19. #define MDB_DIRTY 2
  20. #define MDB_BLOCKTYPE 12
  21. #define MDB_VIRTUAL 16
  22. #define MDB_BIGMODULE 32
  23.   unsigned char flags1;
  24. #define MDB_GENERAL 0
  25.   unsigned char modtype;
  26.   unsigned short comref;
  27.   unsigned short compref;
  28.   unsigned short futref;
  29.   char name[12];
  30.   unsigned long size;
  31.   char modname[32];
  32.   unsigned long date;
  33.   unsigned short playtime;
  34.   unsigned char channels;
  35.   unsigned char moduleflags;
  36.   unsigned char flags2;
  37. #define MDB_COMPOSER 4
  38.   char composer[32];
  39.   char style[31];
  40.   unsigned char flags3;
  41. #define MDB_COMMENT 8
  42.   char comment[63];
  43.   unsigned char flags4;
  44. #define MDB_FUTURE 12
  45.   char dum[63];
  46. };
  47.  
  48. enum
  49. {
  50.   mtMOD=0, mtMODd=1, mtMODt=2, mtM31=3, mtM15=6, mtM15t=7, mtWOW=8,
  51.   mtS3M=9, mtXM=10, mtMTM=11, mt669=12, mtULT=13, mtDMF=14, mtOKT=15,
  52.   mtMID=16, mtCDA=17, mtMIDd=18, mtPTM=19, mtMED=20, mtMDL=21, mtAMS=22,
  53.   mtINP=23, mtDEVp=24, mtDEVs=25, mtDEVw=26, mtIT=27, mtWAV=28, mtVOC=29,
  54.   mtUnRead=0xFF
  55. };
  56.  
  57. char fsGetNextFile(char *, moduleinfostruct &info, binfile *&fi);
  58. char fsFilesLeft();
  59. signed char fsFileSelect();
  60. char fsAddFiles(const char *);
  61. char fsInit();
  62. void fsClose();
  63.  
  64. struct arcentry
  65. {
  66. #define ADB_USED 1
  67. #define ADB_DIRTY 2
  68. #define ADB_ARC 4
  69.   unsigned short flags;
  70.   unsigned short parent;
  71.   char name[12];
  72.   unsigned long size;
  73. };
  74.  
  75. enum
  76. {
  77.   adbCallGet, adbCallDelete, adbCallMoveTo, adbCallMoveFrom, adbCallPut
  78. };
  79.  
  80. struct adbregstruct
  81. {
  82.   const char *ext;
  83.   int (*Scan)(const char *path);
  84.   int (*Call)(int act, const char *apath, const char *file, const char *dpath);
  85.   adbregstruct *next;
  86. };
  87.  
  88. struct modlistentry
  89. {
  90.   char name[12];
  91.   unsigned short dirref;
  92.   unsigned short fileref;
  93. };
  94.  
  95. struct modlist;
  96.  
  97. struct mdbreaddirregstruct
  98. {
  99.   int (*ReadDir)(modlist &ml, unsigned short dirref, const char *mask, unsigned long opt);
  100.   mdbreaddirregstruct *next;
  101. };
  102. #define RD_PUTSUBS 1
  103. #define RD_ARCSCAN 2
  104. #define RD_DIRRECURSE 4
  105. #define RD_PUTDSUBS 16
  106.  
  107. char *dmGetPath(char *path, unsigned short ref);
  108. unsigned short dmGetPathReference(const char *p);
  109. unsigned short dmGetDriveDir(int drv);
  110.  
  111. int adbAdd(const arcentry &a);
  112. unsigned short adbFind(const char *arcname);
  113. int adbCallArc(const char *cmd, const char *arc, const char *name, const char *dir);
  114. int fsIsModule(const char *ext);
  115. void fsConvFileName12(char *c, const char *f, const char *e);
  116. int fsMatchFileName12(const char *a, const char *b);
  117. void fsConv12FileName(char *f, const char *c);
  118.  
  119. extern char fsScanInArc;
  120. unsigned short mdbGetModuleReference(const char *name, unsigned long size);
  121. int mdbGetModuleInfo(moduleinfostruct &m, unsigned short fileref);
  122. int mdbWriteModuleInfo(unsigned short fileref, moduleinfostruct &m);
  123. int mdbInfoRead(unsigned short fileref);
  124. int mdbGetModuleType(unsigned short fileref);
  125. int mdbReadMemInfo(moduleinfostruct &m, const unsigned char *buf, int len);
  126. int mdbAppend(modlist &m, const modlistentry &f);
  127. int mdbAppendNew(modlist &m, const modlistentry &f);
  128.  
  129. #define MIF_EXT ".MDZ"
  130.  
  131. struct mdbreadnforegstruct
  132. {
  133.   int (*ReadMemInfo)(moduleinfostruct &m, const unsigned char *buf, int len);
  134.   int (*ReadInfo)(moduleinfostruct &m, binfile &f, const unsigned char *buf, int len);
  135.   mdbreadnforegstruct *next;
  136. };
  137.  
  138. struct interfacestruct
  139. {
  140.   int (*Init)(const char *path, moduleinfostruct &info, binfile *f);
  141.   int (*Run)();
  142.   void (*Close)();
  143. };
  144.  
  145. struct preprocregstruct
  146. {
  147.   void (*Preprocess)(const char *path, moduleinfostruct &info, binfile *&f);
  148.   preprocregstruct *next;
  149. };
  150.  
  151. struct fsgetfileregstruct
  152. {
  153.   void (*GetFile)(char *path, binfile *&f);
  154.   fsgetfileregstruct *next;
  155. };
  156.  
  157. #endif
  158.